package day02;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class InputStreamOutputStreamDemo {

	public static void main(String[] args) throws IOException {

		BufferedInputStream bis =
				new BufferedInputStream(new FileInputStream("e:\\a.jpg"));
		BufferedOutputStream bos = new BufferedOutputStream(
				new FileOutputStream("e:\\b.jpg"));

		int b;
		while ((b = bis.read()) != -1) {
			bos.write(b);
			bos.flush();
		}
		bis.close();
		bos.close();
	}
}
